/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package paca;

/**
 *
 * @author Usuario1
 */
public class ConexionBD {

    private static final java.lang.String JDBC_DRIVER = "com.mysql.jdbc.Driver";
    private static final java.lang.String DB_URL = "jdbc:mysql://localhost/java";
    private static final java.lang.String USER = "root";
    private static final java.lang.String PASS = "";
    private static java.sql.Connection conn = null;
    private static java.sql.Statement stmt = null;
    private static java.lang.String sql = null;

    private static boolean Conectar() {
        boolean conectado = false;
        if (ConexionBD.conn != null) {
            return true;
        }
        try {
            java.lang.Class.forName(JDBC_DRIVER);
            ConexionBD.conn = java.sql.DriverManager.getConnection(DB_URL, USER, PASS);
            conectado = true;
        } catch (java.lang.ClassNotFoundException cnfe) {
            System.out.println(cnfe.toString());
        } catch (java.sql.SQLException sqle) {
            System.out.println(sqle.toString());
        } finally {
            return conectado;
        }
    }

    private static boolean desconectar() {
        return true;
    }

}
